SOFTWARE-GRADE ANALYTICS / PIPELINE AUTOMATION

Collect, analyze, publish.
One command. Every day.

XSMB Analytics collapses the manual cycle of collecting Northern Vietnam lottery results, computing frequency/recency statistics, and publishing charts into a single typed CLI — run daily by CI and deployed to GitHub Pages as an interactive Plotly dashboard.

View source code ↗

ROLE

Data / Software Engineer

SCOPE

Individual project

DATA

Daily XSMB draws · incremental CSV history

STACK

Python · pydantic · Typer · Plotly · GitHub Actions · GitHub Pages

01 / CONTEXT & PROBLEM

Analytics scripts rot. Engineered pipelines don't.

Most personal analytics projects are a notebook that worked once. This project's real objective was engineering discipline on a small, honest dataset: strict typing, validated inputs, incremental state, tests that gate every change, and automation that keeps the output current without a human in the loop.

02 / ARCHITECTURE

A typed pipeline behind one CLI

Daily XSMB results

collected on schedule

→

pydantic validation

typed models · malformed draws rejected

→

Incremental CSV history

append-only · dedup on draw date

→

Analytics engine

frequency · recency · pattern statistics

→

Plotly dashboard

auto-published to GitHub Pages daily

Typer CLI wraps every stage · GitHub Actions runs the full cycle daily · strict mypy + 30+ tests gate merges

03 / KEY DECISIONS & RESULTS

Discipline over dataset size

Strict mypy + pydantic everywhere

Every record and config passes typed validation; an upstream format change fails loudly at the boundary instead of corrupting history silently.

Modular stages behind one Typer CLI

Collect, validate, analyze and publish are separate testable modules; the CLI composes them so CI and a human run exactly the same path.

Statistics, honestly framed

Frequency and recency views describe historical draws — the dashboard never claims predictive power over a random process. Framing outputs truthfully is part of the job.

1

command replaces the whole manual collect-analyze-report cycle

30+

tests + strict mypy gating every merge

Daily

CI/CD refresh publishing the dashboard to GitHub Pages

04 / WHAT I'D DO DIFFERENTLY

Graduate the storage layer.

Incremental CSV is transparent and diff-able, but as history grows I'd move to DuckDB or SQLite for typed queries and faster aggregates — keeping the CSV export as the human-readable artifact rather than the system of record.